#include <algorithm>
#include <iostream>
#include <ctime>

using namespace std;

const long N = 11;

long Z[] = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 0, 0 };
long L = sizeof(Z) / sizeof(Z[0]);

int main(void)
{
	long j = 0;

	clock_t t = clock();

	do {
		if (Z[0] == 0) break;

		long m = 0;
		for (long i = 0; i < L; i += 2) {
			m += (Z[i] * 10 + Z[i + 1]);
		}

		if (m % N == 0) {
			j++;
		}
	} while (next_permutation(Z, Z+L));

	t = clock() - t;

	cout << j << endl;
	cout << (float(t)) / CLOCKS_PER_SEC << endl;

	return 0;
}
